﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Windows;

namespace Test
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

        }
        Random random = new Random();
        List<double> xs = new List<double>();
        List<double> ys = new List<double>();

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            int count = 50;
            xs.Clear();
            ys.Clear();
            for (int i = 0; i < count; i++)
            {
                xs.Add(i * 10000 / count + random.Next(100));
                ys.Add(random.Next(10000));
            }
            var ds = new ObservableCollection<VisualView.Series.XYSeriesDataSource<double, double>>()
            {
                new VisualView.Series.XYSeriesDataSource<double, double>(){Count=count,GetXFunc=(i)=>{return xs[i]; },GetYFunc=(i)=>{return ys[i]; } }
            };
            seriespoint.DataSource = ds;
            seriesline.DataSource = ds;
            //serieshistogram.DataSource = ds;
        }
    }
}
